package com.kla.power.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.kla.power.vo.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 设备：逆变器、汇流箱、电表、组件、微逆、机器人、无人机
 * </p>
 * @author WuZH
 * @since 2023-06-23
 */
@Data
@TableName ("device_info")
@ApiModel (value = "DeviceEntity对象", description = "设备：逆变器、电表、组件（监控器）、机器人、无人机")
public class DeviceEntity extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty ("逆变器")
    @TableId (value = "id", type = IdType.INPUT)
    private String id;

    @ApiModelProperty ("设备标题")
    @TableField ("deviceTitle")
    private String deviceTitle;

    @ApiModelProperty ("设备SN编号-003")
    @TableField ("deviceSn")
    private String deviceSn;

    @ApiModelProperty ("发电站表ID")
    @TableField ("stationId")
    private String stationId;

    @ApiModelProperty ("父Id，当设备为逆变器时父Id为采集器Id")
    @TableField ("parentId")
    private String parentId;

    @ApiModelProperty ("安装地址")
    @TableField ("address")
    private String address;

    @ApiModelProperty ("录入的装机容量")
    @TableField ("power")
    private String power;

    @ApiModelProperty ("设备类型")
    @TableField ("deviceType")
    private Integer deviceType;

    @TableField ("createTime")
    private Date createTime;
    @TableField (exist = false)
    private String lastCreateTime; //最后更新时间，解析为字符串时间格式传给前端

    @ApiModelProperty ("系统更新时间")
    @TableField ("changeTime")
    private Date changeTime;

    @TableField ("isUsed")
    private Integer isUsed;


    @TableField (exist = false)
    private String inverterId; // 逆变器Id
    @TableField (exist = false)
    private String workStatus; // 设备工作状态
    @TableField (exist = false)
    private String parentName;  // 所属父设备
    @TableField (exist = false)
    private String stationName; // 电站名称
    @TableField (exist = false)
    private String gridPower;        // 发电功率
    @TableField (exist = false)
    private String todayEnergy;// 日发电量
    @TableField (exist = false)
    private String fullHour;// 日发电量
    @TableField(exist = false)
    private String avgActivePower = "0.0"; // 功率归一化

    @TableField (exist = false)
    private String totalEnergy; // 所有逆变器总的发电量

    @TableField (exist = false)
    private Integer timeType;// 要查询的历史数据的时间类型，1日，2周，3月，4年

    @TableField (exist = false)
    private List<DeviceEntity> deviceEntities;
    @TableField (exist = false)
    private String merchantId; // 商户Id

    @TableField (exist = false)
    private String allDCPower; //总直流功率
    @TableField (exist = false)
    private String allActivePower;//交流输出总功率
}
